package com.stadium.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.stadium.bean.Order;

public interface OrderRepository extends JpaRepository<Order, Integer> {
	
	@Query("SELECT o FROM Order o WHERE o.status=?1 ")
	List<Order> findAll(Integer status);
	
	@Query("SELECT o FROM Order o WHERE o.borrowAccount=?1 ")
	List<Order> findAll(String account);
	
	@Query("SELECT o FROM Order o WHERE o.applyReturn=1 AND isReturn=0")
	List<Order> getAllApplyOrder();
}
